package com.txra.txramall.order.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.txra.txramall.order.entity.OrderEntity;
import com.txra.txramall.order.service.OrderService;


@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    /**
     * 根据用户id查询订单信息
     * @param userId
     * @return
     */
    @RequestMapping("/findOrderByUserId/{userId}")
    public List<OrderEntity> findOrderByUserId(@PathVariable("userId") Integer userId) {
    	
    	return orderService.listByUserId(userId);

    }

    

}
